{% if update %}
{% import 'languages/'+lang|default('en')+'.html' as lang %}
{% endif %}
{% set checking_types = {'tcp': '1', 'http': '2', 'ping': '4', 'dns': '5'} %}
<div class="sort_menu">
    <div style="margin-bottom: 15px">
		{% set down = [] %}
		{% set up = [] %}
		{% set dis = [] %}
		{% for s in smon %}
			{% if s.en == 1 %}
				{% if s.status == 1 and s.body_status == 1 %}
					{% if up.append('1') %} {% endif %}
				{% else %}
					{% if down.append('1') %} {% endif %}
				{% endif %}
			{% else %}
				{% if dis.append(s.group) %} {% endif %}
			{% endif %}
		{% endfor %}
		<b>{{lang.smon_page.desc.status_summary}}: {{lang.smon_page.desc.UP}}: {{up|length}}, {{lang.smon_page.desc.DOWN}}: {{down|length}}, {{lang.words.disabled|title()}}: {{dis|length}}</b>
    </div>
    <a title="{{lang.smon_page.desc.do_not_sort_by_status}}" style="cursor: pointer" onclick="showSmon('not_sort')">{{lang.smon_page.desc.do_not_sort}}</a> |
    <a id="sort_by_status" title="{{lang.smon_page.desc.sort_status}}" style="cursor: pointer" onclick="sort_by_status()">{{lang.smon_page.desc.sort_status}}</a> |
    <a title="SMOM: {{lang.words.dashboard|title()}} - Roxy-WI" style="cursor: pointer" onclick="showSmon('refresh');">{{lang.words.refresh2|title()}}</a>
</div>
{% set group = [] %}
{% set group_prev = [] %}
<div id="dashboards">
    {%- for s in smon -%}
        {% if s.group not in group %}
        <div class="smon_group">
            <div class="group_name">
                {% if s.group %} {{ s.group }} {% else %} None {% endif %}
            </div>
        </div>
        {% endif %}
        {% if group.append(s.group) %} {% endif %}
        <div class="smon_services {{additional_classes}} animated-background" id="smon-{{ s.id }}"></div>
        {% set check_id = checking_types[s.check_type] %}
        <script>
            getSmonCheck('{{ s.id }}', '{{ check_id }}');
        </script>
    {% endfor %}
</div>
<script>
    {% if sort == 'by_status' %}
        sort_by_status();
    {% endif %}
</script>
